import realClass.User;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

/**
 * @Author quan
 * @Description 通过factory获取对象
 * @Date 2023/7/12 17:43
 */

public class a03_factory {
    public static void main(String[] args) {
        BeanFactory factory = new XmlBeanFactory(new ClassPathResource("spring-config.xml"));
        User user = (User) factory.getBean("user");
        user.sayHello();
    }
}
